﻿<phone:PhoneApplicationPage 
    x:Class="Payton.WP7.Views.StatusDetailView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    Foreground="{StaticResource PhoneForegroundBrush}" 
    SupportedOrientations="PortraitOrLandscape"
    d:DataContext="{d:DesignData /SampleData/StatusDetailViewModelSampleData.xaml}"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False" Orientation="Portrait">
   
    <!--LayoutRoot is the root grid where all page content is placed-->

    <Grid x:Name="LayoutRoot" Background="{StaticResource BackroundBrush}" >
        <Rectangle Style="{StaticResource SpliterStyle}" >
          
        </Rectangle>
        <!--<Border Grid.RowSpan="2" Margin="0,140,0,0"  Background="{StaticResource BorderContainerBrush2}" BorderBrush="#FF413B3B"/>-->
        <Path VerticalAlignment="Top" Data="M20,20 L0,40 L40,40 Z" Fill="{StaticResource BorderContainerBrush1}" Margin="48,100,0,0"/>
        <toolkit:PerformanceProgressBar x:Name="progressIndicator" IsIndeterminate="{Binding Loading}" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
        <controls:Pivot Name="pivot" Foreground="LightGray" SelectedIndex="{Binding PivotSelectedIndex,Mode=TwoWay}">
            <controls:PivotItem Margin="0,10,0,0">
                <controls:PivotItem.Header>
                    <Grid Width="440" Margin="-10,-10,-10,0">
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="2" >
                            <Image toolkit:TiltEffect.IsTiltEnabled="True"  delay:LowProfileImageLoader.UriSource ="{Binding FaceImageUri}"  VerticalAlignment="Top" Margin="8,14"  Height="80" Width="80" Tap="OnTapToUserHome">
                                <Image.Clip>
                                    <RectangleGeometry RadiusX="8" RadiusY="8" Rect="0,0,80,80"/>
                                </Image.Clip>
                            </Image>
                            <TextBlock toolkit:TiltEffect.IsTiltEnabled="True" FontSize="26" Margin="0,8,0,12" VerticalAlignment="Top" Text="{Binding Item.User.Name}" Foreground="{StaticResource PhoneAccentBrush}"/>
                            <Image Margin="0,16,0,12" Height="24" Visibility="{Binding Item.User.Verified,Converter={StaticResource BoolToVisibilityConverter}}" Width="24" Source="/Icons/verify_icon.png" VerticalAlignment="Top"/>
                        </StackPanel>
                        <TextBlock Text="{Binding Item.User.Description}" TextWrapping="Wrap" FontSize="16" Foreground="Gray" Margin="100,45,0,0"/>
                    </Grid>
                </controls:PivotItem.Header>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                                 
                    <ScrollViewer x:Name="sv" Margin="2,16,2,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <Grid d:DesignHeight="238" d:DesignWidth="639" Margin="2">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Row="1"  Margin="12,6"  Text="{Binding Item.Text}" TextWrapping="Wrap"/>
                            <Image HorizontalAlignment="Left" Margin="12" Grid.Row="2" MaxHeight="1800" Source="{Binding Image}"/>

                            <Border Visibility="{Binding HasRetweet,Converter={StaticResource BoolToVisibilityConverter}}" Grid.Row="2" Style="{StaticResource StatusDetailRetwiteBorderStyle}">
                             
                              <Path VerticalAlignment="Top" Data="M10,10 L0,20 L20,20 Z" Fill="{StaticResource BorderContainerBrush1}" Margin="26,-20,-8,4"/> 
                                 
                            </Border>
                            <Grid Style="{StaticResource StatusDetailRetwiteGridStyle}" Visibility="{Binding HasRetweet,Converter={StaticResource BoolToVisibilityConverter}}" Grid.Row="2" >
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>

                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock x:Name="tbRetUserName" Tap="tbRetUserName_Tap" Text="{Binding Item.RetweetedStatus.User.Name}" Foreground="{StaticResource PhoneAccentBrush}"/>
                                        <Image VerticalAlignment="Top" Margin="2,6,0,0" Visibility="{Binding Item.RetweetedStatus.User.Verified,Converter={StaticResource BoolToVisibilityConverter}}" Width="18" Source="/Icons/verify_icon.png"/>
                                    </StackPanel>
                                    <TextBlock Margin="2" Tap="TextBlock_Tap" Grid.Row="1" Text="{Binding Item.RetweetedStatus.Text}" TextWrapping="Wrap"/>
                                <Image Grid.Row="2" Margin="2" HorizontalAlignment="Left" MaxHeight="1800" Source="{Binding RetweetImage}"/>
                                </Grid>
                        </Grid>
                    </ScrollViewer>
					       
                    <TextBox Name="tbRepost" Text="{Binding RepostText,Mode=TwoWay}" Margin="0,0,10,70" Grid.Row="1">
                            <TextBox.Style>
                                <StaticResource ResourceKey="TextBoxStyle1"/>
                            </TextBox.Style>
                    </TextBox>
                </Grid>
                    
            </controls:PivotItem>
            <controls:PivotItem  Margin="0,14,0,0">
                <controls:PivotItem.Header>

                    	<TextBlock Margin="-10,40,0,0" Text="{Binding CommentText, Source={StaticResource AppResx}}" VerticalAlignment="Bottom"  FontSize="48" />
                   
                </controls:PivotItem.Header>
            	<Grid>
            		<Grid.RowDefinitions>
            			<RowDefinition Height="*"/>
            			<RowDefinition Height="Auto"/>
            		</Grid.RowDefinitions>

                    <ListBox Margin="2,12,2,0" x:Name="commentsList" ItemTemplate="{StaticResource CommentListDataTemplateLite}" ItemContainerStyle="{StaticResource ListBoxItemStyle2}"  ItemsPanel="{StaticResource ItemsPanelTemplate1}"  ItemsSource="{Binding Comments}" HorizontalContentAlignment="Stretch" VerticalAlignment="Stretch" />
                    <!--<TextBlock Visibility="{Binding HasComments, Converter={StaticResource BoolToVisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10"  Text="{Binding LoadingText, Mode=TwoWay}"  />-->
            		<TextBox x:Name="tbReply" Text="{Binding CommentText, Mode=TwoWay}"  Margin="0,0,10,70" Grid.Row="1" Style="{StaticResource TextBoxStyle1}"/>
            	</Grid>
            </controls:PivotItem>
        </controls:Pivot>
        
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    -->
</phone:PhoneApplicationPage>
